﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NAnt.Core.Attributes;
using NAnt.Core;
using UofCASE.AgileProductLinerDSL.Nant.Tasks.Models;

namespace UofCASE.AgileProductLinerDSL.Nant.Tasks
{

    /*
         *  <AspenTest 
         *      Platform="Windows"
         *      ProductLinerDir="path\to\ProductLiner"
         *      assemblyPath="path\to\assembly.dll"
         *      />
         */

    [TaskName("AspenTest")]
    class AspenTestNantTask : Task
    {
        /*
         *  <AspenTest 
         *      Platform="Windows"
         *      ProductLinerDir="path\to\ProductLiner"
         *      assemblyPath="path\to\assembly.dll"
         *      />
         */

        private AspenTest tester { get; set; }

        public String ResultsDir
        {
            get
            {
                return tester.ResultsDir;
            }
        }

        [TaskAttribute("solutionRoot", Required = false)]
        [StringValidator(AllowEmpty = false)]
        public string SolutionRoot
        {
            get { return tester.SolutionRoot; }
            set { tester.SolutionRoot = value; }
        }

        [TaskAttribute("assemblyPath", Required = true)]
        [StringValidator(AllowEmpty = false)]
        public string AssemblyPath
        {
            get { return tester.AssemblyPath; }
            set { tester.AssemblyPath = value; }
        }

        [TaskAttribute("ProductLinerDir", Required = true)]
        [StringValidator(AllowEmpty = false)]
        public string ProductLinerDir
        {
            get { return tester.ProductLinerDir; }
            set { tester.ProductLinerDir = value; }
        }

        [TaskAttribute("Platform", Required = true)]
        [StringValidator(AllowEmpty = false)]
        public string Platform
        {
            get { return tester.Platform; }
            set { tester.Platform = value; }
        }

        [TaskAttribute("CollectionPlan", Required = true)]
        [StringValidator(AllowEmpty = false)]
        public string CollectionPlan
        {
            get { return tester.CollectionPlan; }
            set { tester.CollectionPlan = value; }
        }

        public string PlatformDir
        {
            get
            {
                return tester.PlatformDir;
            }
        }

        public AspenTestNantTask()
        {
            tester = new AspenTest();
        }

        protected override void ExecuteTask()
        {
            tester.ExecuteTask();
        }

    }
}
